#define _CRT_SECURE_NO_WARNINGS 1
#include"string.h";
using namespace tai;


void test_string1()
{
	string s1("hello bit");
	string s2;
	cout << s1.c_str();
	cout << s2.c_str();

}


void test_string2()
{
	String s1("hello bit");
	for (size_t i = 0; i < s1.size(); i++)
	{
		cout << s1[i];
	}
	cout << endl;

	String::iterator it = s1.begin();
	while (it != s1.end())
	{
		cout << *it;
		it++;
	}
	cout << endl;

	for (auto ch : s1)
	{
		cout << ch;
	}
	cout << endl;

}



void test_string3()
{
	String s3;
	String s1("hello bitxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
	String s2(s1);
	s3 = s2;
	cout << s2.c_str() << endl;
	cout << s1.c_str() << endl;
	cout << s3.c_str() << endl;


}


void test_string4()
{
	String s1;
	s1.push_back('x');
	s1.push_back('x');
	s1.push_back('x');
	s1.push_back('x');
	s1.push_back('x');
	s1 += 'c';
	String s2;
	s2.append("hello bit");
	s2 += "1111111";
	
	cout << s1.c_str() << endl;
	cout << s2.c_str() << endl;
	s1.clear();
	s2.clear();
	cout << s1.c_str() << endl;
	cout << s2.c_str() << endl;


}


void test_string5()
{
	String s1;
	s1.push_back('x');
	s1.push_back('x');
	s1.push_back('x');
	s1.push_back('x');
	s1.push_back('x');
	s1 += 'c';
	String s2;
	s2.append("hello bit");
	cout << s1.c_str() << endl;
	cout << s2.c_str() << endl;
	s1.swap(s2);
	cout << s1.c_str() << endl;
	cout << s2.c_str() << endl;
}

void test_string6()
{
	String s1;
	s1.push_back('a');
	s1.push_back('x');
	s1.push_back('x');
	s1.push_back('x');
	s1.push_back('x');
	s1 += 'c';
	String s2;
	s2 += "xxxxx6666666666666666666666666666666666666";
	s2.append("h");
	String s3("hello bit");
	cout << s2;
	/*cout << (s1 < s2) << endl;
	cout << (s1 <= s3) << endl;
	cout << (s1 < s3) << endl;
	cout << (s2 == s3) << endl;*/




}


void test_string7()
{
	String s2("hello bit");
	/*s2.insert(2, 'x');
	cout << s2.c_str() << endl;
	s2.insert(s2.size(), 'x');
	cout << s2.c_str() << endl;
	s2.insert(0, 'x');
	cout << s2.c_str() << endl;
	s2.erase(s2.size() - 1, 1);
	cout << s2.c_str() << endl;

	s2.insert(0, "hello bit");
	cout << s2.c_str() << endl;

	s2.insert(6, "hello bit");
	cout << s2.c_str() << endl;
	s2.insert(0, "hello bit");
	cout << s2.c_str() << endl;

	s2.insert(s2.size(), "hello bit");
	cout << s2.c_str() << endl;
	cout << s2;*/
	cin >> s2;
	cout << s2 << endl;
	s2.erase(3 , 10);
	cout << s2;
}


void test_string8()
{
	String s2("hello bit");
	String s3("xaxaxaxaxaxa");
	s2.swap(s3);
	
}

int main()
{

	//test_string1();
	//test_string2();
	//test_string3();
	//test_string5();
	//est_string6();
	test_string7();
	//test_string8(); 

	return 0;
}